bitkeeper revision 1.1681 (42a4172fYhXBx6d4aXa2ofB5qVB2Ww)
authorcl349@firebug.cl.cam.ac.uk <cl349@firebug.cl.cam.ac.uk>
Mon, 6 Jun 2005 09:28:15 +0000 (09:28 +0000)
committercl349@firebug.cl.cam.ac.uk <cl349@firebug.cl.cam.ac.uk>
Mon, 6 Jun 2005 09:28:15 +0000 (09:28 +0000)
xc_gnttab.c, xc_evtchn.c:
  Cleanup error message printing and error exit code path.
xc_vmx_build.c, xc_private.c, xc_plan9_build.c, xc_linux_build.c:
  Cleanup error message printing.
Signed-off-by: Nguyen Anh Quynh <aquynh@gmail.com>
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
tools/libxc/xc_evtchn.c
tools/libxc/xc_gnttab.c
tools/libxc/xc_linux_build.c
tools/libxc/xc_plan9_build.c
tools/libxc/xc_private.c
tools/libxc/xc_vmx_build.c

index 8ee2fd11ee5b75286aee60e2afe4c8ccfe7127aa..1c0294d83b10d4ea253e487cdc751a453a77e7fd 100644 (file)
@@ -19,15 +19,16 @@ static int do_evtchn_op(int xc_handle, evtchn_op_t *op)
 
     if ( mlock(op, sizeof(*op)) != 0 )
     {
-        PERROR("Could not lock memory for Xen hypercall");
-        goto out1;
+        PERROR("do_evtchn_op: op mlock failed");
+        goto out;
     }
 
-    if ( (ret = do_xen_hypercall(xc_handle, &hypercall)) < 0 )
-        goto out2;
+    if ((ret = do_xen_hypercall(xc_handle, &hypercall)) < 0)
+        ERROR("do_evtchn_op: HYPERVISOR_event_channel_op failed: %d", ret);
 
- out2: (void)munlock(op, sizeof(*op));
- out1: return ret;
+    (void)munlock(op, sizeof(*op));
+ out:
+    return ret;
 }
 
 
index 2601c30f60ce9bc112f2984111e7ac20fae11500..ad23e68013e617958d161949f7d0b83ce4102b24 100644 (file)
@@ -26,18 +26,16 @@ do_gnttab_op( int xc_handle,
 
     if ( mlock(op, sizeof(*op)) != 0 )
     {
-        PERROR("Could not lock memory for Xen hypercall");
-        goto out1;
+        PERROR("do_gnttab_op: op mlock failed");
+        goto out;
     }
 
     if ( (ret = do_xen_hypercall(xc_handle, &hypercall)) < 0 )
-    {
-        printf("do_gnttab_op: hypercall returned error %d\n", ret);
-        goto out2;
-    }
+        ERROR("do_gnttab_op: HYPERVISOR_grant_table_op failed: %d", ret);
 
- out2: (void)munlock(op, sizeof(*op));
- out1: return ret;
+    (void)munlock(op, sizeof(*op));
+ out:
+    return ret;
 }
 
 
index f90f3f3aefc9e89a3f12903922f8a4d7e26e0e3e..83e7ca8d4c253f49044d78a05851dc033b8a112e 100644 (file)
@@ -193,7 +193,7 @@ static int setup_guest(int xc_handle,
     }
 
     (load_funcs.loadimage)(image, image_size, xc_handle, dom, page_array,
-                          &dsi);
+                           &dsi);
 
     /* Load the initial ramdisk image. */
     if ( initrd_len != 0 )
@@ -466,7 +466,7 @@ int xc_linux_build(int xc_handle,
 
     if ( mlock(&st_ctxt, sizeof(st_ctxt) ) )
     {   
-        PERROR("Unable to mlock ctxt");
+        PERROR("xc_linux_build: ctxt mlock failed");
         return 1;
     }
 
index 08ac06d08a6a9bfe04381d8cc09d84d02470ae45..544485aa423cde2538c9f86fc5c9e91bb2d7f792 100644 (file)
@@ -434,7 +434,7 @@ xc_plan9_build(int xc_handle,
 
        DPRINTF(("xc_get_tot_pages returns %ld pages\n", tot_pages));
        if (mlock(&st_ctxt, sizeof (st_ctxt))) {
-               PERROR("Unable to mlock ctxt");
+               PERROR("xc_plan9_build: ctxt mlock failed");
                return 1;
        }
 
index 7b8ec3d11348a81cac3929af3768bc01d0f5e9a2..87e5ecd1f32b33ec6a7c76436a3888ae8bb68af6 100644 (file)
@@ -122,7 +122,7 @@ static int flush_mmu_updates(int xc_handle, mmu_t *mmu)
 
     if ( mlock(mmu->updates, sizeof(mmu->updates)) != 0 )
     {
-        PERROR("Could not lock pagetable update array");
+        PERROR("flush_mmu_updates: mmu updates mlock failed");
         err = 1;
         goto out;
     }
@@ -226,7 +226,7 @@ int xc_get_pfn_list(int xc_handle,
 
     if ( mlock(pfn_buf, max_pfns * sizeof(unsigned long)) != 0 )
     {
-        PERROR("Could not lock pfn list buffer");
+        PERROR("xc_get_pfn_list: pfn_buf mlock failed");
         return -1;
     }    
 
index b5e948c622d10a18e8baf5625e16b40cd3b520dc..c30fd4c49b8b03e2e7561be6861b3bdd35f590fd 100644 (file)
@@ -529,7 +529,7 @@ int xc_vmx_build(int xc_handle,
 
     if ( mlock(&st_ctxt, sizeof(st_ctxt) ) )
     {   
-        PERROR("Unable to mlock ctxt");
+        PERROR("xc_vmx_build: ctxt mlock failed");
         return 1;
     }